Skip to content

docs(modal): add playgrounds for sheet and card modal drag events#4415

Open
thetaPC wants to merge 12 commits intofeature-8.8from
FW-7051
Open

docs(modal): add playgrounds for sheet and card modal drag events#4415
thetaPC wants to merge 12 commits intofeature-8.8from
FW-7051

Conversation

@thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Feb 24, 2026

⚠️ DO NOT MERGE: Remove dev build first!! ⚠️

Issue URL: internal

What is the current behavior?

The sheet and card modal can be dragged to view content. However, there are no events that determine when drag has started or ended.

What is the new behavior?

  • Added playgrounds for the sheet and card modal to demonstrate how a developer may use the drag events.
  • Added the drag detail to the interface section

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.7.17-dev.11772118942.181221d4

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-docs Ready Ready Preview, Comment Feb 27, 2026 9:46pm

Request Review


<CardExample />

### Drag Events for Card Modals
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had the section titles just Drag Events on both sections but then the URLs were drag-events for Card and drag-events1 for Sheet. That seemed weird to me so I made the titles more unique.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we had one section for Event Handling like Reorder or Range?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea. I can just use one of the modals. Most likely the sheet modal to show off what currentBreakpoint does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thetaPC thetaPC marked this pull request as ready for review February 26, 2026 16:56
@thetaPC thetaPC requested a review from a team as a code owner February 26, 2026 16:56
@thetaPC thetaPC requested review from ShaneK and brandyscarney and removed request for a team and ShaneK February 26, 2026 16:56
@ShaneK ShaneK changed the title docs(modal): add playgrounds for sheet and card model drag events docs(modal): add playgrounds for sheet and card modal drag events Feb 27, 2026
Copy link
Member

@ShaneK ShaneK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple things that more or less depend on what you do with the framework PR

*/
currentY: number;
/**
* The change in Y position since the last event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is a documentation issue or an implementation one, but the way this event is set up right now, deltaY is calculated since the gesture started, not the last event. It's also documented that way in your recent changes, which is why I think that's an issue here, not there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- `currentY` and `deltaY`: Track the absolute position and the change in distance since the last frame, useful for calculating drag direction.
- `velocityY`: Measures the speed of the drag, which can be used to trigger specific animations if a user "flicks" the modal.
- `progress`: A normalized value between 0 and 1 representing how far the modal is open. This is ideal for dynamically adjusting the opacity of an overlay or scaling background content as the modal moves.
- `currentBreakpoint`: For sheet modals, this identifies which breakpoint the modal will snap to if released at that moment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on what you do about this change request, this description may be incorrect because predicted breakpoints at higher velocities may not be where they actually stop if let go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants